package com.lizhi.yun.db.sfrobot.entity;


import com.lizhi.mybatis.boot.Description;
import com.lizhi.yun.db.sfrobot.common.IllnessSideType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

@Data
@ToString
@Entity
@Table(name = "his_center_assess_table")
@Description("评估")
public class AssessTable extends AbstractHisEntity {

    @Id
    @Column(length = 30)
    @Description("lid")
    public String lid;

    @Description("记录id")
    public Long id;

    /**
     * 评估记录Id
     */
    @Column
    @Description("评估记录id")
    public Long recordId;

    @Column
    @Description("评估项id")
    public Long templateId;

    @Column
    @Description("评估项编号")
    public String templateCode;

    /**
     * 评估模板名称
     */
    @Column(length = 50)
    @Description("评估项名称")
    public String templateText;

    /**
     * 总得分
     */
    @Column
    @Description("评估总分")
    public Float score;

    @Column
    @Description("排序号")
    public Integer sortIndex;
    /**
     * 患病侧
     */
    @Column
    @Description("患侧")
    public Integer illnessSide;

    @Description("患侧")
    @Transient
    public String illnessSideText;

    @Column(length = 4000)
    @Description("评估值")
    public String assessValue;

    @Column(length = 20)
    @Description("创建时间")
    public String createTime;


    /*云管需要的数据*/
    @ApiModelProperty(value = "医院ID")
    private String hospitalId;

    @ApiModelProperty(value = "系统ID")
    private String hospitalSystemId;

    public String getIllnessSideText() {
        if (IllnessSideType.SideBoth.getEnValue().equals(this.illnessSide)){
            this.illnessSideText = IllnessSideType.SideBoth.getEnName();
        } else if (IllnessSideType.SideLeft.getEnValue().equals(this.illnessSide)){
            this.illnessSideText = IllnessSideType.SideLeft.getEnName();
        } else if (IllnessSideType.SideRight.getEnValue().equals(this.illnessSide)){
            this.illnessSideText = IllnessSideType.SideRight.getEnName();
        }
        return illnessSideText;
    }
}
